Optimal. Leaf size=117 \[ \frac {\sqrt {a} (3 A+4 B+8 C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{4 d}+\frac {a (A+4 B) \sin (c+d x)}{4 d \sqrt {a \sec (c+d x)+a}}+\frac {A \sin (c+d x) \cos (c+d x) \sqrt {a \sec (c+d x)+a}}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.28, antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.093, Rules used = {4086, 4015, 3774, 203} \[ \frac {\sqrt {a} (3 A+4 B+8 C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{4 d}+\frac {a (A+4 B) \sin (c+d x)}{4 d \sqrt {a \sec (c+d x)+a}}+\frac {A \sin (c+d x) \cos (c+d x) \sqrt {a \sec (c+d x)+a}}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 3774
Rule 4015
Rule 4086
Rubi steps
\begin {align*} \int \cos ^2(c+d x) \sqrt {a+a \sec (c+d x)} \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos (c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (\frac {1}{2} a (A+4 B)+\frac {1}{2} a (A+4 C) \sec (c+d x)\right ) \, dx}{2 a}\\ &=\frac {a (A+4 B) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{2 d}+\frac {1}{8} (3 A+4 B+8 C) \int \sqrt {a+a \sec (c+d x)} \, dx\\ &=\frac {a (A+4 B) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{2 d}-\frac {(a (3 A+4 B+8 C)) \operatorname {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 d}\\ &=\frac {\sqrt {a} (3 A+4 B+8 C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 d}+\frac {a (A+4 B) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.50, size = 113, normalized size = 0.97 \[ \frac {\sqrt {\cos (c+d x)} \sec \left (\frac {1}{2} (c+d x)\right ) \sqrt {a (\sec (c+d x)+1)} \left (\sqrt {2} (3 A+4 B+8 C) \sin ^{-1}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right )+2 \sin \left (\frac {1}{2} (c+d x)\right ) \sqrt {\cos (c+d x)} (2 A \cos (c+d x)+3 A+4 B)\right )}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.60, size = 320, normalized size = 2.74 \[ \left [\frac {{\left ({\left (3 \, A + 4 \, B + 8 \, C\right )} \cos \left (d x + c\right ) + 3 \, A + 4 \, B + 8 \, C\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, {\left (2 \, A \cos \left (d x + c\right )^{2} + {\left (3 \, A + 4 \, B\right )} \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{8 \, {\left (d \cos \left (d x + c\right ) + d\right )}}, -\frac {{\left ({\left (3 \, A + 4 \, B + 8 \, C\right )} \cos \left (d x + c\right ) + 3 \, A + 4 \, B + 8 \, C\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - {\left (2 \, A \cos \left (d x + c\right )^{2} + {\left (3 \, A + 4 \, B\right )} \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{4 \, {\left (d \cos \left (d x + c\right ) + d\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.70, size = 660, normalized size = 5.64 \[ -\frac {{\left (3 \, A \sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 4 \, B \sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 8 \, C \sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - a {\left (2 \, \sqrt {2} + 3\right )} \right |}\right ) - {\left (3 \, A \sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 4 \, B \sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 8 \, C \sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + a {\left (2 \, \sqrt {2} - 3\right )} \right |}\right ) - \frac {4 \, \sqrt {2} {\left (5 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} A \sqrt {-a} a \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 12 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} B \sqrt {-a} a \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 19 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} A \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 76 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} B \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 17 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} A \sqrt {-a} a^{3} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 36 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} B \sqrt {-a} a^{3} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + A \sqrt {-a} a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 4 \, B \sqrt {-a} a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )}}{{\left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} - 6 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a + a^{2}\right )}^{2}}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 1.98, size = 548, normalized size = 4.68 \[ -\frac {\left (-3 A \sqrt {2}\, \cos \left (d x +c \right ) \sin \left (d x +c \right ) \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}}-4 B \sqrt {2}\, \cos \left (d x +c \right ) \sin \left (d x +c \right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right )-8 C \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sin \left (d x +c \right ) \cos \left (d x +c \right )-3 A \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sin \left (d x +c \right )-4 B \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sin \left (d x +c \right )-8 C \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sin \left (d x +c \right )+8 A \left (\cos ^{4}\left (d x +c \right )\right )+4 A \left (\cos ^{3}\left (d x +c \right )\right )+16 B \left (\cos ^{3}\left (d x +c \right )\right )-12 A \left (\cos ^{2}\left (d x +c \right )\right )-16 B \left (\cos ^{2}\left (d x +c \right )\right )\right ) \sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}}{16 d \cos \left (d x +c \right ) \sin \left (d x +c \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.83, size = 1996, normalized size = 17.06 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int {\cos \left (c+d\,x\right )}^2\,\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________